package 循环输出;

/**
 * @author Administrator
 * @ClassName RunnableTest
 * @TIME 星期三 2020/12/30
 */
public class RunnableTest {
    public static void main(String[] args) {
        long start = System.currentTimeMillis();

        Tickect t = new Tickect();
        Thread thread1 = new Thread(t);
        Thread thread2 = new Thread(t);
        Thread thread3 = new Thread(t);
        Thread thread4 = new Thread(t);
        Thread thread5 = new Thread(t);
        thread1.start();
        thread5.start();
        thread2.start();
        thread3.start();
        thread4.start();
        long  end = System.currentTimeMillis();
        System.out.println(end - start +"Runabble MS");
        System.out.println(t.end - t.start +"Tickect MS");
    }
}

class Tickect implements Runnable {
    long start = System.currentTimeMillis();

    @Override
    public void run() {
        for (int i = 0; i < 10000; i++) {
            System.out.println(i);
        }
    }
    long  end = System.currentTimeMillis();
}
